<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:pe="http://primefaces.org/ui/extensions"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/templates/templateLayout.xhtml">

	<f:metadata>
		<f:event type="preRenderView" listener="#{homeBean.verificarTasaInteres}"/>
	</f:metadata>


	
	<ui:define name="centerContent">
		<script type="text/javascript"
			src="http://maps.google.com/maps/api/js?sensor=true"></script>
			
		<h:panelGroup id="idreference" layout="block"
			class="title ui-widget-header ui-corner-all"
			style="padding: 8px; font-size: 16px !important; text-align: center;">
			<h:outputText value="#{msgs['home.titulo']}" />
			<p:messages id="messagesFilter" showDetail="true"  closable="true" showSummary="true"/>
			<p:gmap center="#{homeBean.centro.lat}, #{homeBean.centro.lng}"
				zoom="13" type="MAP" model="#{homeBean.advancedModel}" id="mainMapId"
				style="width:100%; height:350px" widgetVar="mainMap">
				<p:ajax event="overlaySelect" listener="#{homeBean.onMarkerSelect}" />
				<p:gmapInfoWindow>
					<p:outputPanel style="text-align:center;display:block;margin:auto:">
						<h:panelGrid columns="1">
							<h:link outcome="/pages/alquiler/create"  style="color:#FF0000;"
								title="Alquilar Propiedad">
									#{homeBean.marker.title} Alquilar
									<f:param name="idPropiedad" value="#{homeBean.marker.data}" />
							</h:link>
							<h:link outcome="/pages/propiedad/view"  style="color:#FF0000;"
								title="Detalles de la Propiedad">
									#{homeBean.marker.title} Detalles
									<f:param name="id" value="#{homeBean.marker.data}" />
							</h:link>
						</h:panelGrid>
					</p:outputPanel>
				</p:gmapInfoWindow>
			</p:gmap>				
		</h:panelGroup>
		
		<p:panelGrid columns="3">
			<p:panel header="Contabilidad">
						<h:link   outcome="/pages/cuenta/view">							
								<p:panelGrid columns="2">
									<p:outputLabel value="Saldo Cuenta Caja" />
									<h:outputLabel value="#{homeBean.cuenta.saldo}">
										<f:convertNumber currencySymbol="$" type="currency"
											maxFractionDigits="2" />
									</h:outputLabel>
								</p:panelGrid>
							<f:param name="caja" value="ok" />
						</h:link>
			</p:panel>				
			<ui:include src="/pages/shared/cuentaListaConTotal.xhtml">
					<ui:param name="listaCuentas" value="#{homeBean.deudores}" />
					<ui:param name="titulo" value="#{msgs.deudores}" />
					<ui:param name="total" value="#{homeBean.totalDeuda}" />
					<ui:param name="orden" value="ascending" />
			</ui:include>
			<ui:include src="/pages/shared/cuentaListaConTotal.xhtml">
					<ui:param name="listaCuentas" value="#{homeBean.acredores}" />
					<ui:param name="titulo" value="#{msgs.acredores}" />
					<ui:param name="total" value="#{homeBean.totalAdredor}" />
					<ui:param name="orden" value="descending" />
			</ui:include>							       			    
		</p:panelGrid>	

	</ui:define>
</ui:composition>
</html>